<extend name="Layout/ins_page" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">

	<select name="folder_list" id="folder_list" class="hidden">
		<option value="0">根节点</option>
		{:fill_option($folder_list)}
	</select>


	{:W('PageHeader/simple',array('name'=>$folder_name,'search'=>'N'))}
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-right">

				<a onclick="save()" class="btn btn-sm btn-primary">保存</a>

			</div>
		</div>
	</div>
	<div class="row">



		<div class="col-sm-12">
			<form id="form_data" name="form_data" method="post" class="well form-horizontal clearfix" >
                <div class="form-group ">
                    <label class="col-sm-3 control-label" for="insuranceDate">时间*：</label>
                    <div class="col-sm-9">
                        <div class="input-daterange input-group">
                            <input class="input-sm form-control text-center"  readonly="readonly" type="text" id="insuranceDate" name="insuranceDate" check="require" msg="请输入时间">
                        </div>
                    </div>
                </div>
				<div class="form-group">
					<label class="col-sm-3 control-label" for="carNum">车牌号*：</label>
					<div class="col-sm-9">
						<input class="form-control" type="text" id="carNum" name="carNum" check="require" msg="请输入车牌号">
					</div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="type">投保种类*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="type" name="type" check="require" msg="请输入投保种类">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="money">投保金额*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="money" name="money" check="require" msg="请输入投保金额">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="company">投保公司*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="company" name="company" check="require" msg="请输入投保公司">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="handle">办理人*：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="handle" name="handle" check="require" msg="请输入办理人">
                    </div>
                </div>
                <div class="form-group ">
                    <label class="col-sm-3 control-label" for="expireDate">到期日*：</label>
                    <div class="col-sm-9">
                        <div class="input-daterange input-group">
                            <input class="input-sm form-control text-center"  readonly="readonly" type="text" id="expireDate" name="expireDate" check="require" msg="请输入时间">
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="remark">备注：</label>
                    <div class="col-sm-9">
                        <input class="form-control" type="text" id="remark" name="remark"  msg="请输入办理人">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label" for="name">附件：</label>
                    <div class="col-sm-9">
                        {:W('FileUpload/add')}
                    </div>
                </div>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function save() {
            if (check_form("form_data")) {
                var vars = $("#form_data").serialize();
                    sendAjax("{:U('addInsurance')}", vars, function(data) {
                        if (data.status) {
                            ui_alert(data.info, function() {
                                parent.location.reload(true);
                            });
                        }else{
                            ui_error(data.info);
                        }
                    });
                }else{
                    ui_error("未修改任何数据项");
                }
        }
    </script>
</block>